UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '027DLkA2FQfL/sALmbP6BbQ2NqLu64nDWF7SncNLoAM=' 
WHERE 
  key_id = '47dc454dfb38e8fcbc1a096c0b379a0707b3b2219865485aa4c2127f7eb6dd6a' 
  AND (
    token = '027DLkA2FQfL/sALmbP6BbQ2NqLu64nDWF7SncNLoAM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023