UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EFvJibVCT3XaAczRwUfoWnfAQQxIW1bt0jguEJoJdqw=' 
WHERE 
  key_id = '281a00355b283fe294f83b88970f97c5f0bf2176946f664b0313a7c27e5fc2d6' 
  AND (
    token = 'EFvJibVCT3XaAczRwUfoWnfAQQxIW1bt0jguEJoJdqw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032