UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oRysm3n6E6Xzx4XUqJP4sKHjBhBioR2ul08ZFBQoHAM=' 
WHERE 
  key_id = '6d678c382ca04684adaa537d7d04dc2fcfb6da25c9379ec623e613d85e7acba6' 
  AND (
    token = 'oRysm3n6E6Xzx4XUqJP4sKHjBhBioR2ul08ZFBQoHAM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024