UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HTKYOcdeE3u/OOBxUrHM81iSQ0IgjpKR0sYv/JimXkM=' 
WHERE 
  key_id = '7de8d7477f2bcc022a5a964faa735a64faca93275f99b9a31bbb1ffa4251402f' 
  AND (
    token = 'HTKYOcdeE3u/OOBxUrHM81iSQ0IgjpKR0sYv/JimXkM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029