UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'al6Y+k0hw9A4OT4m5Xhqz4kJkDIwfapmSzwpTL7AIYY=' 
WHERE 
  key_id = '240860c2d34acd202282ddb00dc65f6a54bbb994f362b8d441ac08684f06af12' 
  AND (
    token = 'al6Y+k0hw9A4OT4m5Xhqz4kJkDIwfapmSzwpTL7AIYY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020