UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UiX+hvStY38rWHYdw22g6579/SBID+e43I2PLVlm1TY=' 
WHERE 
  key_id = 'e203711cdbfaa94de36f3a1fae08ea346fdc3a1e10d34ed2ecb4c733b10de872' 
  AND (
    token = 'UiX+hvStY38rWHYdw22g6579/SBID+e43I2PLVlm1TY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034