UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'f2wMcaDLthG1bg3OOvFjHEhBAvECwJmDWSCGpni7b1I=' 
WHERE 
  key_id = '04b4ddd0f85d06318e95c1b50e681fbba40df913b049bfc386a43fcc6f39df99' 
  AND (
    token = 'f2wMcaDLthG1bg3OOvFjHEhBAvECwJmDWSCGpni7b1I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042