UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'A7OsEHYXQQlsGq9fN+KiZZ7rzXFcl8STeCgiCz5GEfc=' 
WHERE 
  key_id = '30b19ee623e92c441a55c193cb92a3de6cb3c99d3366797b917a95e4c7fefce4' 
  AND (
    token = 'A7OsEHYXQQlsGq9fN+KiZZ7rzXFcl8STeCgiCz5GEfc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00014