UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qb8UuPds619oUKcc7Dvp8mhcPuLvu1GwxEx4Sey/XqU=' 
WHERE 
  key_id = '8c1358320771b693afcd5df7d879b6df5bfc44364385c105125a43f85c09fc28' 
  AND (
    token = 'qb8UuPds619oUKcc7Dvp8mhcPuLvu1GwxEx4Sey/XqU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040