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

Query time 0.00034