UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/74uz7Den6K4AUMyCRzXI1kYu0E4MEZnJT/Uu4ryfs4=' 
WHERE 
  key_id = '5a08860ae1f543c93f4f54593eb13d8cba88c44aff669d843a2ff5075f4f537c' 
  AND (
    token = '/74uz7Den6K4AUMyCRzXI1kYu0E4MEZnJT/Uu4ryfs4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023