UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3/PI+nR3p8ir3sGQ77AyomJC1EPKKM/1BZeeGKR9rEE=' 
WHERE 
  key_id = '4d12c8571d838d578a1010df9cad8d2093bc0db003537b8f76b6c655f3d461d8' 
  AND (
    token = '3/PI+nR3p8ir3sGQ77AyomJC1EPKKM/1BZeeGKR9rEE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042