UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TyOSbvz5bR0Xc957Ac7Mtrff58NstV7+Fu0Y0pw6/vg=' 
WHERE 
  key_id = '971a8ec1640cf1c6ea29b42441fc1f8d73cb11a742fc5ff0cb5c4dd27efc275a' 
  AND (
    token = 'TyOSbvz5bR0Xc957Ac7Mtrff58NstV7+Fu0Y0pw6/vg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034