UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'v6wIdHWKAYWPGgYT8acCalarHNr70cdSRzLyjpjc/wk=' 
WHERE 
  key_id = '76d461a2a1a417ae80e489a3d7a41077c219b6b48768e14f957056ff4fe0e1e0' 
  AND (
    token = 'v6wIdHWKAYWPGgYT8acCalarHNr70cdSRzLyjpjc/wk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029