UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'a+ORLnn2qYl6N9Dd+XS0b4laV8FuveY58rZvO4roK1A=' 
WHERE 
  key_id = '0f5d5aaa981b4f0ef9ee4c6b5cbd53ba8aa375b56d2e69b251c84a748d31b8a5' 
  AND (
    token = 'a+ORLnn2qYl6N9Dd+XS0b4laV8FuveY58rZvO4roK1A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030