UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QnSFaGQFx5e4GIfg2dyv9ya/NvouWk63ouwOx6kRNLw=' 
WHERE 
  key_id = 'd433ec7c38a3fa40cba32aa9547164d8babfee2e166853caa317dd080edc1058' 
  AND (
    token = 'QnSFaGQFx5e4GIfg2dyv9ya/NvouWk63ouwOx6kRNLw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030