UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xSL30/j2Kv3d+a1ByOsf/SInVll1XmeRBzD2IzQe0mc=' 
WHERE 
  key_id = '98b1321f970cedb8a20b8b13d15af5027a0aa6897ed77d2a6bf2e8fd639dfc0c' 
  AND (
    token = 'xSL30/j2Kv3d+a1ByOsf/SInVll1XmeRBzD2IzQe0mc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037