UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HZawkcfyS1in6uyH/++7jMaaSrq/JV8Wjwo1nYQGGTQ=' 
WHERE 
  key_id = '74b45fa26d6e92855e672a6a2451ad503c8464cdfb9b68119aacdc6e1bb6cc40' 
  AND (
    token = 'HZawkcfyS1in6uyH/++7jMaaSrq/JV8Wjwo1nYQGGTQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049