UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WRwXmrxVA6jbk6Um2VOki0ev8RjdijrS7NBAv/u6va4=' 
WHERE 
  key_id = '103580306fb63bcfef9ea40297bde63705c3d0e678cb38f1fe38231ec0818ff9' 
  AND (
    token = 'WRwXmrxVA6jbk6Um2VOki0ev8RjdijrS7NBAv/u6va4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047