UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZwDITIuT1C7kLgtynMWb9Y7lxBa/ju/Sh6QaSYsw7jQ=' 
WHERE 
  key_id = 'ab315b04c75ee0747518f1542f700e83eccee56f9578e798b836b69e0ee49078' 
  AND (
    token = 'ZwDITIuT1C7kLgtynMWb9Y7lxBa/ju/Sh6QaSYsw7jQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034