UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YlxBicsL0QBjNK938bjuikwUfmOmedn1kfYgZTpEyRM=' 
WHERE 
  key_id = '2e482c2f19f95d49ea979bf8265ae88fd34e5e3cc4a5435748e1a375f9bc406f' 
  AND (
    token = 'YlxBicsL0QBjNK938bjuikwUfmOmedn1kfYgZTpEyRM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033