UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'w2EijnfRVmMjBfO1p42a8qaAPSZISyI/zuAwlIV4G5w=' 
WHERE 
  key_id = '918d388f9c5d7755b6af49570d9b2b8b30b777bb53d51bcd1edbe09eb6390f87' 
  AND (
    token = 'w2EijnfRVmMjBfO1p42a8qaAPSZISyI/zuAwlIV4G5w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021