UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UudNwf4soba1882umDS9s6kdRHXU2Fa3WMrXYJy2iQE=' 
WHERE 
  key_id = 'bf9cf7f43ea28e09f4f7bd873c05894edd4a9588b080901256acda9bd0a3d7f3' 
  AND (
    token = 'UudNwf4soba1882umDS9s6kdRHXU2Fa3WMrXYJy2iQE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035