UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9HyMCfdQeXa6INAXwiIulO31tgv2gB4/3qUBwLb32fA=' 
WHERE 
  key_id = '0afb3d4a4a16c4e369728f9b2a8736313ebdc7d3ce7c99f8a002e59c2314f618' 
  AND (
    token = '9HyMCfdQeXa6INAXwiIulO31tgv2gB4/3qUBwLb32fA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033