UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZLbURFTks1/gDDXAx/cKX+mhjHYFdq0VbMq9SKQH/lc=' 
WHERE 
  key_id = '3873b523c9a1eed505f55bcfef257919a85bce9d87bd76ce199dd4bd9b10b70e' 
  AND (
    token = 'ZLbURFTks1/gDDXAx/cKX+mhjHYFdq0VbMq9SKQH/lc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022