UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 't7O6w7voar5MkAu+4xdop/P0DJbD+tTouj6nThxhTQY=' 
WHERE 
  key_id = '11dcc2fe16a087a23fd1c37935884703e3389622315cfdd3e0f04f8066d6b349' 
  AND (
    token = 't7O6w7voar5MkAu+4xdop/P0DJbD+tTouj6nThxhTQY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036