UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xqmzkq+F0KoAD+XkQYIkFVfxW29/XjtJ62ClbdN/ACc=' 
WHERE 
  key_id = 'f77c04c0b0aab8abe68908bb799a81796ca47b2dddb6d9974061e3a7c6446b96' 
  AND (
    token = 'xqmzkq+F0KoAD+XkQYIkFVfxW29/XjtJ62ClbdN/ACc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041