UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '557Jce13VVqX5mPLIB4XnhA5+kjRMQwypDmpvc4oHao=' 
WHERE 
  key_id = '1f064b48e00a9f50362cdb4c31c18b55ed51b159c58fb8e79799af1d185742b0' 
  AND (
    token = '557Jce13VVqX5mPLIB4XnhA5+kjRMQwypDmpvc4oHao=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033