UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EGRBlizJPwzVCuwNzwOlnPjEpGsr+D4vdXjgM+pWxJo=' 
WHERE 
  key_id = 'f7fcdd7d8847e0022b4d69caa4a0e128aada29f851c1a678919b3e810d9785d3' 
  AND (
    token = 'EGRBlizJPwzVCuwNzwOlnPjEpGsr+D4vdXjgM+pWxJo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033