UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wCZ1PTqhu0lMo7y7GS0BU5paCeOxkveQbZ9woJSYS9Q=' 
WHERE 
  key_id = 'a8ecfc35d7154729e6025b6e17745b8cc15c5daec462c159254f361bbd94c930' 
  AND (
    token = 'wCZ1PTqhu0lMo7y7GS0BU5paCeOxkveQbZ9woJSYS9Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035