UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HAr+ZuONZIKcdCOy9fHp8mO+/0j9+Jt0vo3AAk2N3W0=' 
WHERE 
  key_id = 'cf3a50c00056d23551008a54badc0ca3d0120b5a86d80016207dd75e2fb00c60' 
  AND (
    token = 'HAr+ZuONZIKcdCOy9fHp8mO+/0j9+Jt0vo3AAk2N3W0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026