UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1YzUBhvLl8+lo+/zGbNJ5vWkuE+AkL2CJGJkonsuiAs=' 
WHERE 
  key_id = '9f7e8a00e9a6ad771c52f62f7f34335792b5ff93f6a0ec6a8ca54f4af7efbe8f' 
  AND (
    token = '1YzUBhvLl8+lo+/zGbNJ5vWkuE+AkL2CJGJkonsuiAs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015