UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'udLeJ9RVyipR7W3vM9LpoQ2GibR2NoHR7JyyHpLXzQ0=' 
WHERE 
  key_id = 'c0aaa8f7660a348a5d85a82506231371709e10ade884bf8d505c347231e861c0' 
  AND (
    token = 'udLeJ9RVyipR7W3vM9LpoQ2GibR2NoHR7JyyHpLXzQ0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028