UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'v2QrC+mlgfKJPvlUqqAKf9fns+3HHIgWLJ8dIZ6c5t8=' 
WHERE 
  key_id = '0b45fb82c4ee87aa63ee38d6fb88849f16b0857a518cc3706f2a24f11175ad0c' 
  AND (
    token = 'v2QrC+mlgfKJPvlUqqAKf9fns+3HHIgWLJ8dIZ6c5t8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021