UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VtSiNwR9hJxhDSAWW1QZEnG13oy/xmZSHSKGZhkia/s=' 
WHERE 
  key_id = '9cad1d33d819fab7d18afb7cebf3ac4d26a2ee841627d558a8d23f55a9b7802d' 
  AND (
    token = 'VtSiNwR9hJxhDSAWW1QZEnG13oy/xmZSHSKGZhkia/s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028