UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7CC/Xviswj6KmokH6TpYr49tNQGwKd2bjkb6dWd4D7A=' 
WHERE 
  key_id = 'be2ac00a699736fbcdab0b4d6782c4fa30410efef3fcfdb57c6f487245d96f7d' 
  AND (
    token = '7CC/Xviswj6KmokH6TpYr49tNQGwKd2bjkb6dWd4D7A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027